package com.risk.web.controller.ds;

import com.risk.common.core.controller.BaseController;
import com.risk.common.core.domain.AjaxResult;
import com.risk.common.core.page.TableDataInfo;
import com.risk.kernel.domain.DsCallRecord;
import com.risk.kernel.service.DsCallRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: Liwen
 * @createTime: 2024/12/3
 * @description: 数据源调用查询
 */
@RestController
@RequestMapping(value = "/ds")
public class DsCallRecordController extends BaseController {

    @Autowired
    private DsCallRecordService recordService;

    @PreAuthorize("@ss.hasPermi('ds:record:list')")
    @GetMapping("/call/record/list")
    public TableDataInfo list(String searchValue) {
        startPage();
        List<DsCallRecord> list = recordService.selectDsCallRecordList(searchValue);
        return getDataTable(list);
    }
    /**
     * 删除
     */
    @PreAuthorize("@ss.hasPermi('ds:record:remove')")
    @DeleteMapping("/record/bathRemove/{ids}")
    public AjaxResult remove(@PathVariable String[] ids) {
        return toAjax(recordService.deleteRecordBath(ids));
    }
}
